<template>
  <view class="header">
    <u-navbar
      :title="title"
      :background="{'background': background}"
      :is-back="isBack"
      :is-fixed="isFixed"
      :title-bold="titleBold"
      back-icon-color="auto"
      :border-bottom="borderBottom"
      @click-right="onClickRight"
      :title-color="textColor"
      @click-left="onClickLeft"
      @click.native="handelSearch(val)"
    >
      <view class="slot-wrap">
        <view class="flex Jstart Acenter" >
          <u-icon name="search" color="#999999" size="36" style="margin: 0 20upx;"></u-icon>
          <!-- <text style="font-size:30upx;color:#999999;"></text> -->
        </view>
			</view>
    </u-navbar>
  </view>
</template>

<script>
export default {
  name: 'header-lsearch',
  props: {
    title: {
      type: String,
      default: '',
    },
    isBack: {
      type: Boolean,
      default: false,
    },
    background: {
      type: String,
      default: '#ffffff',
    },
    textColor: {
      type: String,
      default: '#323233',
    },
    borderBottom: {
      type: Boolean,
      default: true,
    },
    searchText: {
      type: String,
      default: '请输入搜索内容',
    },
      isFixed:{
        type:Boolean,
        default:false
    },
    titleBold:{
        type:Boolean,
        default:false
    }
  },
  data() {
    return {
    };
  },
  computed:{
  },
  watch:{
  },
  created() {
  },
  methods: {
    // 返回点击
    onClickLeft() {
        console.log('left')
      uni.navigateBack({
        delta: 1 
      });
    },
    onClickRight() {},
    handelSearch(val){
      let vm = this;
      vm.$emit("handelHeaderSearch",val)
    },
  },
};
</script>

<style scoped lang='scss' >
.slot-wrap {
  width: 100%;
  display: flex;
  justify-content: space-between;
  padding: 0px 30upx;
}
</style>
